/*
dictionarymediator.h
(c) 2010 Yury Hamenkov
This file is part of qWordCards.

qWordCards is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

qWordCards is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with qWordCards. If not, see <http://www.gnu.org/licenses/>.
*/


#ifndef DICTIONARYMEDIATOR_H
#define DICTIONARYMEDIATOR_H

#include <QSet>
#include <QString>


namespace qWordCards {
	class Dictionary;
	class Word;
	
	class DictionaryMediator : public QObject {
	Q_OBJECT
		private:
			const Dictionary* const _dictionary;
			QSet<QString> _forbiddenWords;
			QSet<QString> _suspendedWords;
			QSet<QString> _favouriteWords;
			QSet<QString> _regularWords;
			
			
			
		public:
			explicit DictionaryMediator(const Dictionary* const);
			~DictionaryMediator();
			
			Word GetWord() const;
			
			int GetFavouriteWordsCount() const;
			int GetForbiddenWordsCount() const;
			int GetRegularWordsCount() const;

			Dictionary* GetDictionary() const;
			
		private slots:
			void RebuildLists();
			
		public slots:
			void sl_WordAddedToSuspendedList(QString);
			void sl_WordRemovedFromSuspendedList(QString);
			void sl_WordAddedToFavouriteList(QString);
			void sl_WordRemovedFromFavouriteList(QString);
			void sl_WordAddedToForbiddenList(QString);
			void sl_WordRemovedFromForbiddenList(QString);
	};
}
#endif // DICTIONARYMEDIATOR_H
